package com.ruoyi.web.controller.system;

import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.system.domain.SysKeyCloud;
import com.ruoyi.system.domain.SysKeyPC;
import com.ruoyi.system.service.ISysKeyCloudService;
import com.ruoyi.system.service.ISysKeyPcService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping(value = "/cloud")
public class SysKeyCloudController extends BaseController {
    @Resource
    private ISysKeyCloudService sysKeyCloudService;

    /**
     * 查询【请填写功能名称】列表
     */
    @GetMapping("/list")
    public TableDataInfo list(SysKeyCloud sysKeyYk)
    {
        startPage();
        List<SysKeyCloud> list = sysKeyCloudService.selectSysKeyNzList(sysKeyYk);
        return getDataTable(list);
    }

    /**
     * @Deprecated 新增自己的卡密
     */
    @PostMapping(value = "/addKey")
    private AjaxResult addKey(@RequestBody SysKeyCloud sysKeyYk) {
        return sysKeyCloudService.addKey(sysKeyYk);
    }


    /**
     * @Deprecated 删除自己的卡密
     */
    @PostMapping(value = "/delKey")
    private AjaxResult delKey(@RequestBody SysKeyCloud sysKeyYk) {
        return sysKeyCloudService.delKey(sysKeyYk);
    }


    /**
     * @Deprecated 封停卡密
     */
    @PostMapping("/shutDown")
    private AjaxResult shutDown(String key) {
        return sysKeyCloudService.shutDown(key);
    }

    /**
     * @Deprecated 解绑卡密
     */
    @PostMapping("/noBind")
    private AjaxResult noBind(String key) {
        return sysKeyCloudService.noBind(key);
    }
}
